import { createRouter, createWebHistory } from 'vue-router';

// 静态导入组件
import Index from '../views/index.vue';
import Layout from '@/views/layout.vue';
import Hall from '@/views/hall/hall.vue';
import Personal from '@/views/personal/personal.vue';
import Main from '@/views/main.vue';
import Feedback from "@/views/feedback.vue";
import MyRecord from "@/views/record/myRecord.vue";


const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      component: Index // 使用静态导入的组件
    },
    {
      path: '/layout',
      redirect: '/layout/main',
      component: Layout, // 使用静态导入的组件
      children: [
        {
          path: 'main',
          component: Main // 使用静态导入的组件
        },
        {
          path: 'hall',
          component: Hall // 使用静态导入的组件
        },
        {
          path: 'personal',
          component: Personal // 使用静态导入的组件
        },
        {
          path: 'feedback',
          component: Feedback // 使用静态导入的组件
        },
        {
          path: 'myRecord',
          component: MyRecord // 使用静态导入的组件
        },

      ]
    }
  ]
});


export default router;
